package com.ruoyi.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Author: Ssw
 * @CreateTime: 2022-12-12  15:54
 * @Description:
 */


@AllArgsConstructor
@Getter
public enum DynamicExportTemplateTypeEnum {
    REFUND(10,"售后订单"),
    REFUND_COST(20,"售后费用"),

    GOODS(30,"商品列表")
    ;
    private final Integer code;
    private final String name;


    public static DynamicExportTemplateTypeEnum getEnumByCode(Integer code) {


        return Stream.of(DynamicExportTemplateTypeEnum.values()).filter(e->e.getCode().equals(code)).findFirst().get();
    }
}
